﻿using MyTask.Domain;
using System;
using System.Collections.Generic;
using System.Text;

namespace MyTask.Tasking.Domain.TaskAggregate
{
    public class UserInfo : Entity<long>, IAggregateRoot
    {
        public String FirstName { get; set; }
        public String LastName { get; set; }
        public String UserName { get; set; }
        public String Password { get; set; }

        public string Email { get; set; }

        public DateTime CreateTime { get; set; } = DateTime.Now;

        public List<TaskInfo> TaskList { get; set; }
        protected UserInfo()
        { }

        public UserInfo(string firstName, string lastName, string userName,string password,string email)
        {
            this.FirstName = firstName;
            this.LastName = lastName;
            this.UserName = userName;
            this.Password = password;
            this.Email = Email;
            //this.AddDomainEvent(new OrderCreatedDomainEvent(this));
        }

        public void CreateTask(List<TaskInfo> taskInfos) 
        {
            this.TaskList = taskInfos;
        }

        public void SharedTask(List<TaskInfo> taskInfos)
        {
            this.TaskList = taskInfos;
        }

    }
}
